<?php $priceResume = floatval(settings()->get("post_price", "resume")); ?>
<div class="left">
    <?php
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id' => 'ad-form',
	'enableAjaxValidation' => false,
	'enableClientValidation' => true,
	'clientOptions' => array(
	    'validateOnSubmit' => true
	),
	'type' => 'horizontal',
	'htmlOptions' => array(
	    'enctype' => 'multipart/form-data'
	)
    ));
    ?>
    <?php $this->renderPartial('_edit/_resume-builder', array('model' => $model)); ?>
    <div class="title">Resume</div>

    <?php echo $form->errorSummary($model) ?>

    <div class="sign-1 in-div">
        <div>
            <h4>Your ad category</h4>
            <div class="clear"></div>
	    <?php echo $form->dropDownList($model, 'main_category', CHtml::listData(Category::getList(), 'category_id', 'name'), array('disabled' => 'disabled')); ?>
        </div>
        <div class="otherCat">
            <h4>Post this Ad in another category. </h4>
            <div class="clear"></div>

	    <?php foreach (Category::getList() as $cat) : ?>
    	    <label class="checkbox">
    		<input disabled="disabled" type="checkbox" value="<?php echo $cat->category_id ?>" class="price" name="Resume[otherCategoryIds][]" <?php echo in_array($cat->category_id, $aCatAds) ? 'checked' : '' ?> /><?php echo h($cat->name) ?>
    	    </label>
	    <?php endforeach; ?>	
        </div>               
    </div>

    <div class="sign-1 in-div">
        <h4>Contact Informations</h4>
        <p><em>All contact information will not be posted and is used for communication between you and buyer.</em></p>
        <div>
            <label>Contact Name *</label>
	    <?php echo $form->textField($model, 'contact_name', array('maxlength' => 60)); ?>
        </div>
        <div>
            <label>Email *</label>
	    <?php echo $form->textField($model, 'contact_email', array('maxlength' => 60)); ?>
        </div>
        <div>
            <label>Country</label>
	    <?php echo $form->dropDownList($model, 'contact_country', CHtml::listData(Country::model()->findAll(array('order' => 'country_name')), 'country_iso', 'country_name'), array('maxlength' => 60)); ?>
        </div>
        <div>
            <label>State</label>
	    <?php echo $form->textField($model, 'contact_state', array('maxlength' => 60)); ?>
        </div>

        <div>
            <label>City</label>
	    <?php echo $form->textField($model, 'contact_city', array('maxlength' => 60)); ?>
        </div>
        <div>
            <label>Website</label>
	    <?php echo $form->textField($model, 'website', array('maxlength' => 255)); ?>
        </div>
    </div><!--in-div-->


    <div class="sign-1 in-div">
        <div>
            <h4>Position</h4>
	    <?php echo $form->dropDownList($model, 'position', Resume::getPositions()) ?>
        </div>
    </div><!--in-div-->

    <div class="sign-1 in-div">
        <h4>Employment Location </h4>
        <div>
            <label>Country</label>
	    <?php echo $form->dropDownList($model, 'employmentCountry', Country::getSelectList(), array('maxlength' => 60)); ?>
        </div>


        <div>
            <label>State</label>
            <select>
                <option> Select State</option>
            </select>
        </div>


        <div>
            <label>&nbsp;</label>
            Are you willing to pay for relocation?
	    <?php echo $form->checkBox($model, 'payForRelocation') ?>
        </div>
    </div>

    <div class="sign-1 in-div">
        <h4>Upload Resume </h4>
	<?php
	if ($model->resume) {
	    ?>
    	File uploaded: Click <a href="<?php echo UPLOAD_URL ?>documents/<?php echo $model->resume ?>"><strong>here</strong></a> to view
    	<br><br>
	<?php } ?>
        <div>
	    <?php echo $form->fileField($model, 'resume') ?>
        </div>
	<div>
	    <a data-toggle="modal" href="#resumeBuilder" class="btn btn-primary btn-lg">Resume builder</a>
	</div>
    </div>

    <div class="sign-1 in-div">
        <h4>Brief Description about your self / Objective / Skills</h4>
        <div style="width:500px;">
	    <?php echo $form->textArea($model, 'content', array('rows' => 10, 'cols' => 50, 'class' => 'span6')); ?>
        </div>
    </div>

    <div class="sign-1 in-div">
        <button type="submit" class="btn btn-warning">Save changes</button>
    </div>
    <?php $this->endWidget(); ?>
</div>

<?php $this->renderPartial('//ad/register/_right', array("type" => "resume")) ?>
